﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace ParserGenerator.ParserConstruction
{
    [Serializable]
    public sealed class ParserAutomatonGotos : ReadOnlyDictionary<ParserAutomatonState, ParserAutomatonGoto>
    {
        internal ParserAutomatonGotos()
            : base(new Dictionary<ParserAutomatonState, ParserAutomatonGoto>())
        {
        }

        internal void Add(ParserAutomatonGoto item)
        {
            if (item == null)
                throw new ArgumentNullException(nameof(item));
            Dictionary.Add(item.State, item);
        }
    }
}
